import request from '@/utils/request'

// 获取师训签到时间配置列表
export function getTrainSignTimeConfigList(data) {
  return request({
    url: '/api/campus/trainsigntimeconfig',
    method: 'GET',
    data
  })
}

// 获取师训签到时间配置详情
export function getTrainSignTimeConfigInfo(id) {
  return request({
    url: `/api/campus/trainsigntimeconfig/${id}`,
    method: 'GET'
  })
}

// 创建师训签到时间配置
export function createTrainSignTimeConfig(data) {
  return request({
    url: '/api/campus/trainsigntimeconfig',
    method: 'POST',
    data
  })
}

// 更新师训签到时间配置
export function updateTrainSignTimeConfig(data) {
  return request({
    url: `/api/campus/trainsigntimeconfig/${data.id}`,
    method: 'PUT',
    data
  })
}

// 删除师训签到时间配置
export function deleteTrainSignTimeConfig(id) {
  return request({
    url: `/api/campus/trainsigntimeconfig/${id}`,
    method: 'DELETE'
  })
}

// 批量配置师训签到时间
export function batchConfigTrainSignTime(data) {
  return request({
    url: '/api/campus/trainsigntimeconfig/batch',
    method: 'POST',
    data
  })
}

// 获取师训某天的签到时间配置
export function getDayConfigs(trainId, configDate) {
  return request({
    url: `/api/campus/trainsigntimeconfig/day/${trainId}/${configDate}`,
    method: 'GET'
  })
}

// 验证签到时间
export function validateSignTime(data) {
  return request({
    url: '/api/campus/trainsigntimeconfig/validate',
    method: 'POST',
    data
  })
}

// 验证签到时间（通过参数组合）
export function validateSignTimeByParams(data) {
  return request({
    url: '/api/campus/trainsigntimeconfig/validate-by-params',
    method: 'POST',
    data
  })
}